<?php
include($GLOBALS['cfgPaths']["lib/dba"].'dbaUser.o.inc.php');

if ($env->param('logout') == 'true')
    $env->setSession("auth_".$params['group'], false);

if (!$env->getSession('auth_'.$params['group'])) {
    if ($env->param('user') && $env->param('password')) {
        $userdba = new dbaUser($GLOBALS['udba']);
        if ($userdba->authenticate($env->param('user'),$env->param('password'),$params['group'])) {
            $env->setSession("auth_".$params['group'], true);
        }
    }
}

if ($env->getSession('auth_'.$params['group'])) {
    print '<a class="secLogoutLink" href="?logout=true&doc_id='.$GLOBALS['doc_id'].'">Abmelden</a><br/>';
}

ob_start();

?>